package com.gqk.exception;

import com.gqk.common.result.Result;
import com.gqk.common.result.ResultCodeEnum;

public class YiYunGlobalException extends RuntimeException{
    private Integer code;
    private String message;

    // 自定状态和错误信息
    public YiYunGlobalException(Integer code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

    // 可以接收枚举类
    public YiYunGlobalException(ResultCodeEnum resultCodeEnum){
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
        this.message = resultCodeEnum.getMessage();
    }
}
